package com.jollychic.www.roomdatebasedemo.app;

import android.app.Application;

import com.jollychic.www.roomdatebasedemo.database.GlobalDateBase;


/**
 * desc:  <br/>
 * author: 李超杰 <br/>
 * time: 2018/4/20 0020 20:54 <br/>
 * since: V 6.1X <br/>
 */
public class RMApplication extends Application {

    private static RMApplication INSTANCE;
    private GlobalDateBase dateBase;

    public static synchronized final RMApplication getInstance() {
        return INSTANCE;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        INSTANCE = this;
        //初始化数据库
        initDB();
    }

    private void initDB() {
        dateBase = GlobalDateBase.getInstance(getApplicationContext());
    }

    public GlobalDateBase getDateBase() {
        return dateBase;
    }
}
